package net.dopan.pigframe;

import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.spring.annotation.ApolloConfig;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @Package: net.dopan.pigframe
 * @Title: UserCenterApplication
 * @Description: UserCenter服务启动类
 * @author: 刘宽
 * @date: 2018/10/10 11:06
 */
@EnableAsync
@SpringBootApplication(scanBasePackages = {"net.dopan.pigframe", "net.dopan.pigframe.user", "net.dopan.pigframe.core.bean"})
@EnableEurekaClient
@EnableCircuitBreaker
@EnableFeignClients(basePackages = "net.dopan.pigframe.api.fegin")
@EnableHystrix
@EnableApolloConfig({"application","ignoreurl","bootstrap","activeplatform.druid","activeplatform.redis","activeplatform.rabbitmq","activeplatform.oauth2","activeplatform.log","activeplatform.feign","activeplatform.hystrix","activeplatform.eureka"})
public class UserCenterApplication {

    @ApolloConfig("activeplatform.aliyun")
    private static Config config;

    @Value("${spring.application.name}")
    private static String port;

    public static void main(String[] args) {

        SpringApplication.run(UserCenterApplication.class, args);

        System.err.println("accessKeyId"+config.getProperty("accessKeyId","出错了!"));
        System.out.println("==================UserCenterApplication Start============");
        System.out.println(port+"port");

    }
}
